#include "Candle.h"
#include "Listtexture.h"
#include "Define.h"

Candle::Candle(void){}
Candle::~Candle(void){}
Candle::Candle (int left, int top, int _id)
{
	sprite = new Sprite(Listtexture::CANDLE,Listtexture::CANDLE_WIDTH,Listtexture::CANDLE_HEIGHT,
		Listtexture::CANDLE_COUNT,Listtexture::CANDLE_SPRITEPERROW);
	id = _id;
	type = _CANDLE;
	width = Listtexture::CANDLE_WIDTH;
	height = Listtexture::CANDLE_HEIGHT;
	UpdateRect(left,top,width,height);
	animateRate = Listtexture::CANDLE_ANIMATE;
	lastAnimate = GetTickCount();
}
void Candle::update()
{
	DWORD now = GetTickCount();
	if(now - lastAnimate > animateRate)
	{
		sprite->Next();
		lastAnimate = now;
	}
}